﻿@model SendPrivateMessageModel
@inject IWebHelper webHelper
@{
    Layout = "_ColumnsOne";

    Html.AddTitleParts(T("PageTitle.SendPM").Text);
}
<form asp-route="SendPM" method="post">
    <div class="page private-messages private-message-send-page">
        <h2 class="text-center generalTitle py-3 mb-3">@T("PrivateMessages.Send.PostMessage")</h2>
        <div asp-validation-summary="ModelOnly" class="message-error"></div>
        <input asp-for="ToCustomerId" type="hidden" />
        <input asp-for="ReplyToMessageId" type="hidden" />
        <div class="card form-fields">
            <h5 class="card-header">
                @T("PrivateMessages.Send.To")
                @if (Model.AllowViewingToProfile)
                {
                    <a href="@Url.RouteUrl("CustomerProfile", new { id = Model.ToCustomerId })">@(Model.CustomerToName)</a>
                }
                else
                {
                    <span>@Model.CustomerToName</span>
                }
            </h5>

            <div class="card-body">
                <div class="form-group">
                    <label class="">@T("PrivateMessages.Send.Subject")</label>
                    <input asp-for="Subject" class="form-control pm-title-text" />
                    <span asp-validation-for="Subject"></span>
                </div>
                <div class="form-group message">
                    <label>@T("PrivateMessages.Send.Message")</label>
                    @Html.BBCodeEditor(webHelper, "Message")
                    <textarea asp-for="Message" class="form-control bb-editor-text"></textarea>
                    <span asp-validation-for="Message"></span>
                </div>
            </div>
        </div>
            <div class="btn-group text-center mb-2 mt-3 text-center">
                <input type="submit" class="btn btn-info send-pm-button" value="@T("PrivateMessages.Send.SendButton")" />
                <input type="button" class="btn btn-secondary cancel-pm-button" value="@T("PrivateMessages.Send.CancelButton")" onclick="setLocation('@Url.RouteUrl("PrivateMessages")')" />
            </div>
    </div>
</form>